home *** CD-ROM | disk | FTP | other *** search
-
- 100 ' This programs displays pictures created with PC Paint. These files
- 110 ' are in the standard "BLOAD" format and as such are fully compatible with
- 120 ' systems such as the Polaroid Palette. There is information regarding
- 130 ' color stored in the extra space between the odd and even scan lines.
- 140 ' This program demonstrates how to use that information.
- 150 '
- 160 DEFINT A-Z 'All variables integer
- 170 MODESAVE = &H465 'BIOS Mode location
- 180 MODEREG = &H3D8 'Mode Register on video controller
- 190 BWENABLE = &H4 'Bit to set on Mode byte to control Burst
- 200 COLREG = &H3D9 'Color Register on video controller
- 210 HIGHENABLE = &H10 'Bit to set on Color byte to control intensity
- 220 PALETTEBIT = &H20 'Palette bit in Color byte
- 230 SCREEN 0,1,0 'Text mode
- 240 WIDTH 80 'Set to 80 columns
- 250 KEY OFF
- 260 CLS 'Clear the screen
- 270 '
- 280 ' The program expects the first name of the file only. For example,
- 290 ' "SAILING.PIC" should be entered as "SAILING".
- 300 '
- 310 INPUT "Enter Picture File Name: ",N$
- 320 SCREEN 1,0,0 'Medium Resolution mode
- 330 DEF SEG = &HB800 'Video memory segment
- 340 BLOAD N$+".PIC",0 'Load the picture file
- 350 '
- 360 ' Background and palette information are in two of the bytes that are
- 370 ' not used by the picture.
- 380 '
- 390 PALETTE=PEEK(8012) ' Get palette byte
- 400 BACKGROUND=PEEK(8013) ' Get background byte
- 410 '
- 420 ' If palette is 3,4, or 5, then high intensity palette is enabled.
- 430 ' (See comments below.)
- 440 '
- 450 IF PALETTE>=3 THEN BACKGROUND = BACKGROUND OR HIGHENABLE
- 460 '
- 470 ' Palettes 0 and 3 are video palette 1, burst disabled
- 480 ' Palettes 1 and 4 are video palette 0, burst disabled
- 490 ' Palettes 2 and 5 are video palette 1 (doesn't matter), burst enabled
- 500 '
- 510 IF PALETTE=0 OR PALETTE=3 THEN PALETTE=1 : BURST = 0 : GOTO 650
- 520 IF PALETTE=1 OR PALETTE=4 THEN PALETTE=0 : BURST = 0 : GOTO 650
- 530 IF PALETTE=2 OR PALETTE=5 THEN PALETTE=1 : BURST = 1
- 540 '
- 550 ' The color register accepts one byte with the following format:
- 560 ' Bits 0-3: Background color
- 570 ' Bit 4: Intensified foreground colors
- 580 ' Bit 5: Active palette
- 590 ' Bits 6-7: Not used
- 600 '
- 610 ' The background byte is already in this format, so the palette
- 620 ' information is used to set bits 4 and 5. Line number 450 set
- 630 ' the high intensity bit, and line 650 sets the palette bit.
- 640 '
- 650 IF PALETTE=1 THEN BACKGROUND = BACKGROUND OR PALETTEBIT
- 660 OUT COLREG,BACKGROUND ' Send color byte to the color register
- 670 DEF SEG = 0
- 680 MODE = PEEK(MODESAVE) ' Get current mode
- 690 IF BURST = 0 THEN MODE = MODE AND (NOT BWENABLE) ' Disable burst
- 700 IF BURST = 1 THEN MODE = MODE OR BWENABLE ' or enable burst
- 710 POKE MODESAVE,MODE ' Save new mode
- 720 OUT MODEREG,MODE ' Send the mode byte
- 730 END
-
- or enable burst
- 710 POKE MODESAVE,MODE ' Save new mode
- 720 OUT MODEREG,MODE ' Send th